<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

</head>

<body>
  <div id="app">
      <input type="text" v-model="msg">
      <hr>
      {{ msg.split('').reverse().join('') }}
      <hr>
      {{ reverseMsgFn() }}
      {{ reverseMsgFn() }}
      {{ reverseMsgFn() }}
      <hr>
      {{ reverseMsg }}
      {{ reverseMsg }}
      {{ reverseMsg }}
  </div>
  <script src="./vue.global.js"></script>
  <script>
    const { createApp } = Vue;
    const app = createApp({
      data() {
        return {
          msg: 'hello vue'
        }
      },
      methods: {
        reverseMsgFn() {
          console.log('函数触发');
          return this.msg.split('').reverse().join('')
        }
      },
      computed: {
        reverseMsg(){
          console.log('计算属性触发');
          return this.msg.split('').reverse().join('')
        }
      },
      mounted () {
        console.log(this);
      }
    })
  
    app.mount('#app')
  </script>
</body>

</html>